package com.poizon.api;

import com.poizon.dto.MomentCommentDto;
import com.poizon.service.intf.MomentCommentService;
import com.poizon.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName MomentCommentController
 * @Author NoCheng
 * @Date 2022/1/6 18:18
 * @Description:TODO 动态评论
 */
@RestController
@CrossOrigin
@RequestMapping("/api/momentComment/")
@Api(tags = "评论接口")
public class MomentCommentController {
    private final MomentCommentService service;

    public MomentCommentController(MomentCommentService service) {
        this.service = service;
    }

    @ApiOperation("添加评论")
    @PostMapping()
    public R add(@RequestBody MomentCommentDto dto){
        return service.add(dto);
    }

    @ApiOperation("删除评论(软删除)")
    @PutMapping("{id}")
    public R delete(@PathVariable Long id){
        return service.del(id);
    }

}
